<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<title>后台控制面板--首页</title>
<link rel="stylesheet" type="text/css" href="/style/style.css" />
<link type="text/css" href="/js/jquery/themes/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery/lib/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/js/jquery/ui/jquery-ui-1.8.10.custom.js"></script>
<script type="text/javascript" src="/js/jquery/lib/jquery.cookie.js"></script>
<script type="text/javascript" src="/js/jquery/lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="/js/jquery/plugin/jstree/jquery.jstree.js" ></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	//提示信息
	var msgInfo = '${msgInfo?default("")}';
	if(msgInfo != '' && msgInfo != null){
		alert(msgInfo);
	}
});
function save(){
	if($("#txtTit").val()==""){
		alert("请填写公章标题！");
		return;
	}
	var nodes = $.jstree._reference($("#divOrg")).get_checked(-1, true);
	if(nodes.size() > 0){
		var arr = new Array();
		var idx = 0;
		$.each(nodes, function(i, el) {  
			arr[idx] = $(el).attr("id");
			++idx;
		});
		if(arr.length > 1){
			alert("对不起，您只能选择一个所属部门！");
			return;
		}
		$("#belong_section").val(arr);
	}else{
		alert("请选择所属部门");
		return;
	}
	var filePath = '${sealSignature.file_path?default('')}';
	if(filePath == "" && $("#sealFile").val()==""){
		alert("请添加附件！");
		return;
	}
	$("#officialDoc_doSealEdit").submit();
}
//-->
</script>
</head>
<body class="indexbody">
<#assign f_tit_name="">
<#if sealSignature.id == 0>
<#assign f_tit_name='新增'>
<#else>
<#assign f_tit_name='修改'>
</#if>
<div id="Content">
  <div style="width:100%; ">
  <div urlvalue="Oasp2803">
<div id="Block">
          <div id="BlockHead">
            <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
              <tbody>
                <tr valign="center">
                  <td width="5"></td>
                  <td>公章和头文件管理</td> 
                  <td width="22"></td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="right_con">
                	<ul class="rig_nav">
                    	<li><a href="officialDoc_goSeal.action">公章</a></li>
                        <li><a href="officialDoc_goTemplate.action">头文件</a></li>
                        <li class="rig_nav_on"><a href="javascript:void(0);">${f_tit_name}公章</a></li>
                    </ul>
        </div>
<form method="post" action="officialDoc_doSealEdit.action" id="officialDoc_doSealEdit" name="officialDoc_doSealEdit" enctype="multipart/form-data">
<input type="hidden" id="belong_section" name="sealSignature.belong_section" />
<input type="hidden" id="sealid" name="sealSignature.id" value="${sealSignature.id?default('')}" />
          <div id="BlockDetail">
          <table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="#dddedb">
<tbody>
 <tr>
      <td height=30 colspan="6"  align=left bgColor=#f6f6f6 class="BlockDetailByAdage"><strong class=" mar-l15 linetitle">${f_tit_name}公章</strong></td>
      </tr>
    <tr>
      <td class="STYLE2 STYLE2" bgColor=#f6f6f6  align=right width="15%" height=30><span class="h2-red">*</span>公章名称：</td>
      <td class=STYLE2  bgColor=#f6f6f6  align=left width="35%" height=30><input  
        size=55 name="sealSignature.title" value="${sealSignature.title?default('')}" id="txtTit" /></td>
      <td class=STYLE2 align=right bgColor=#f6f6f6  width="15%"><span class="h2-red">*</span>类型：</td>
      <td class=STYLE2  align=left bgColor=#f6f6f6  width="35%">
      <select id="seal_type" name="sealSignature.seal_type" selval="${sealSignature.seal_type?default('')}">
		<#if paramMap.param1009?exists>
		<#list paramMap.param1009 as item>
			<OPTION value="${item.paramCode}">${item.paramName}</OPTION>
		</#list>
		</#if>
      </select>
      </td></tr>
    <tr align=right>
      <td class=STYLE2 bgColor=#FFFFFF  height=30><span class="h2-red">*</span>所属部门：</td>
      <td class=STYLE3 bgColor=#FFFFFF  align=left colSpan=3 height=30 >
		<div id="divOrg" selvals="${sealSignature.belong_section?default('')}"></div>
<script type="text/javascript" class="source below">
<!--
$(function () {
$("#divOrg")
	.jstree({ 
		// List of active plugins
		"plugins" : [ 
			"themes","json_data","ui","checkbox"
		],

		// I usually configure the plugin that handles the data first
		// This example uses JSON as it is most common
		"json_data" : { 
			// This tree is ajax enabled - as this is most common, and maybe a bit more complex
			// All the options are almost the same as jQuery's AJAX (read the docs)
			"ajax" : {
				// the URL to fetch the data
				"url" : "officialDocGetOrg.action",
				// the `data` function is executed in the instance's scope
				// the parameter is the node being loaded 
				// (may be -1, 0, or undefined when loading the root nodes)
				"dataroot":"orgList",
				"data" : function (n) { 
					// the result is fed to the AJAX request `data` option
					return {
						"orgid" : n.attr ? n.attr("id").replace("node_","") : 0,
						"selSection" : $("#divOrg").attr("selvals")
					}; 
				}
			}
		},
		"checkbox" : {
			"override_ui" : true,
			"two_state" : true
		}
	}).bind("loaded.jstree", function(e, data){
		$("#divOrg").jstree("open_all");
		$("#divOrg").find("li").each(function(){
			if($(this).attr("checkedstate") == "checked"){
				$("#divOrg").jstree("check_node", $(this));
			}
		});
	});
});
//-->
</script>
      </td>
    </tr>
    <tr align=right>
      <td class=STYLE2 bgColor=#FFFFFF  height=30><span class="h2-red">*</span>添加附件：</td>
      <td class=STYLE3 bgColor=#FFFFFF  align=left colSpan=5 height=30 >
      	<input class=fileup id="sealFile" type=file size=30 name="sealSignature.sealFile" />
      	<#if sealSignature.file_path?exists>
      	<div>
      		<img src="${sealSignature.file_path}" style="max-width:800px;max-height:600px;" />
      	</div>
		</#if>
      </td>
    </tr>
    <tr>
      <td class=STYLE1 bgColor=#f6f6f6 align=right height=30>&nbsp;</td>
      <td class=STYLE3  bgColor=#f6f6f6 align=left colSpan=5 height=30>
        <div style="height:30px; margin-top:5px; margin-bottom:5px;">
          <div class="yuding_btn left">
            <!-- 搜索按钮  -->
            <span><span class="xp-b-leftSubmit2"><!-- --></span>
              <a id="uw_flight_submit_lnk" class="xp-b-submit2"  style="line-height:30px;" href="javascript:save();">${f_tit_name}</a> 
              <span class="xp-b-rightSubmit2"><!-- --></span></span>
            </div>
          <div class="yuding_btn left">
            <!-- 搜索按钮  -->
            <span><span class="xp-b-leftSubmit2"><!-- --></span>
              <a id="uw_flight_submit_lnk" class="xp-b-submit2" style="line-height:30px;" href="javascript:document.officialDoc_doSealEdit.reset();">重置</a> 
              <span class="xp-b-rightSubmit2"><!-- --></span></span>
            </div>
          </div>
      </td>
      </tr></tbody></table>
    </div>
</form>
    </div>
    </div>
    </div>
    </div>
<script type="text/javascript">
<!--
$(document).ready(function(){
	//初始化下拉框的值
	$("#seal_type").val($("#seal_type").attr("selval"));
});
//-->
</script>
</body>
</html>